package com.yuxi.excelEntity;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.yuxi.Config.ConfigStatic;
import com.yuxi.Config.PortStaticUtil;
import com.yuxi.Entity.UserTaskCompletion;
import com.yuxi.Util.StringManageUtil;

public class Analysis {	
	private Integer id=0;
	private String port;

	private String SourceChannel;//来源渠道	
	private String prison;
	private String informationConternt; //安全信息内容
	private String taskS="";
	private String mesure;//处置标准及措施	
	private String zeRenPerSonNames;//责任人
	private String zeRenTime;//完成时限
	private String ZeRenRemark;//备注
	//private Integer portId;
	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public String getPort() {
		return port;
	}


	public void setPort(String port) {
		this.port = port;
	}


	public String getPrison() {
		return prison;
	}


	public void setPrison(String prison) {
		this.prison = prison;
	}


	public String getTaskS() {
		return taskS;
	}


	public void setTaskS(String taskS) {
		this.taskS = taskS;
	}


	public String getSourceChannel() {
		return SourceChannel;
	}


	public void setSourceChannel(String sourceChannel) {
		SourceChannel = sourceChannel;
	}


	public String getInformationConternt() {
		return informationConternt;
	}


	public void setInformationConternt(String informationConternt) {
		this.informationConternt = informationConternt;
	}





	public String getMesure() {
		return mesure;
	}


	public void setMesure(String mesure) {
		this.mesure = mesure;
	}


	
	public String getZeRenTime() {
		return zeRenTime;
	}


	public void setZeRenTime(String zeRenTime) {
		this.zeRenTime = zeRenTime;
	}


	public String getZeRenPerSonNames() {
		return zeRenPerSonNames;
	}


	public void setZeRenPerSonNames(String zeRenPerSonNames) {
		this.zeRenPerSonNames = zeRenPerSonNames;
	}


	public String getZeRenRemark() {
		return ZeRenRemark;
	}


	public void setZeRenRemark(String zeRenRemark) {
		ZeRenRemark = zeRenRemark;
	}


//	public Analysis(String sourceChannel, String informationConternt, String informationClassificationId, String mesure,
//			String standard, String zeRenTime, String zeRenPerSonNames, String zeRenRemark) {
//		super();
//		this.SourceChannel = sourceChannel;
//		this.informationConternt = informationConternt;	
//		this.mesure = mesure;	
//		try{
//			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
//			String date = sdf.format(new Date(Long.parseLong(zeRenTime)));	
//			this.zeRenTime = date;
//		}catch(Exception e){
//			this.zeRenTime = "";
//		}
//		this.zeRenPerSonNames =StringManageUtil.removeDot(zeRenPerSonNames);
//		this.ZeRenRemark = zeRenRemark;
//	}

	public Analysis(Integer id,String port, String sourceChannel, String prison, String informationConternt,
			String mesure, String zeRenPerSonNames, String zeRenTime, String zeRenRemark,String portId) {
		super();
		this.id=id;
		
		//this.portId=Integer.parseInt(portId);
		this.port =PortStaticUtil.getAllpreStr(Integer.parseInt(portId));
		//this.port=port;
		SourceChannel = sourceChannel;
		this.prison = prison+"信息";
		this.informationConternt = informationConternt;		
		this.mesure = mesure;
		this.zeRenPerSonNames = StringManageUtil.removeDot(zeRenPerSonNames);		
		ZeRenRemark = zeRenRemark;		
		try{
			if(!ConfigStatic.LongTimeS.equals(zeRenTime)){
				SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
				String date = sdf.format(new Date(Long.parseLong(zeRenTime)));	
				this.zeRenTime = date;
			}else{
				this.zeRenTime = "长期";
			}			
		}catch(Exception e){
			this.zeRenTime = "";
		}
//		this.taskS="";
//		List<UserTaskCompletion> list=new Gson().fromJson(taskS, new TypeToken<List<UserTaskCompletion>>(){}.getType());
//		if(list!=null){
//			for(int i=0;i<list.size();i++){
//				UserTaskCompletion u=list.get(i);
//				//SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
//				//String dat1 = sdf1.format(new Date(Long.parseLong(u.getTime())));				
//				this.taskS+=u.getName()+":"+u.getText();				
//			}	
//		}	
	}


	@Override
	public String toString() {
		return "Analysis [id=" + id + ", port=" + port + ", SourceChannel=" + SourceChannel + ", prison=" + prison
				+ ", informationConternt=" + informationConternt + ", taskS=" + taskS + ", mesure=" + mesure
				+ ", zeRenPerSonNames=" + zeRenPerSonNames + ", zeRenTime=" + zeRenTime + ", ZeRenRemark=" + ZeRenRemark
				+ "]";
	}


	
	
	
	
}
